package com.wuge.gulimall.product.web;

import com.wuge.gulimall.product.service.SkuInfoService;
import com.wuge.gulimall.product.vo.SkuItemVo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
public class ItemController {
    @Resource
    SkuInfoService skuInfoService;
    @RequestMapping("/{skuId}.html")
    public String getItem(@PathVariable("skuId") Long skuId, Model model){
        SkuItemVo skuItemVo = skuInfoService.queryItemSku(skuId);
        model.addAttribute("item",skuItemVo);

        return "item";
    }
}
